import os

def save_to_file(data):
"""
C成员
"""
    with open("diet_plan.txt", "w", encoding='utf-8') as f:
        f.write(str(data))


def read_from_file():

    if os.path.exists("all_foods.txt"):
        with open("all_foods.txt", "r", encoding='utf-8') as f:
            data = f.read()
            return eval(data)
    else:
        print("文件不存在！")
        return {}
